package multithreading.pool;

import java.util.concurrent.*;

public class Threadpool2 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        ExecutorService pool= Executors.newFixedThreadPool(13);
        //处理密集型任务 核心线程数量+1
        //处理io密集型任务 核心线程数量*2
        //2.用线程池来完成callable任务
        Future<String> f1 = pool.submit(new Text3(100));
        Future<String> f2= pool.submit(new Text3(100));
        Future<String> f3=  pool.submit(new Text3(100));
        Future<String> f4= pool.submit(new Text3(100));
        System.out.println(f1.get());
        System.out.println(f2.get());
        System.out.println(f3.get());
        System.out.println(f4.get());
    }
}
